//
//  YQAddressAddBaseCell.swift
//  MuYing
//
//  Created by tbb on 2019/8/1.
//  Copyright © 2019 TBB. All rights reserved.
//

import UIKit

class YQAddressAddBaseCell: YQTableViewBaseCell, QMUITextFieldDelegate{

    @objc var isTextFieldEdit = true;
    
    @objc lazy var textField: QMUITextField = {
        let textField = QMUITextField();
        textField.borderStyle = .none;
        textField.placeholderColor = UIColorFromHex(rgbValue: 0x989898);
        textField.textColor = appMainTitleColor;
        textField.font = UIFont.systemFont(ofSize: 15, weight: .medium);
        textField.tintColor = appThemeColor;
        textField.delegate = self;
        return textField;
    }()
    
    lazy var lineView: UIView = {
        let linewView = UIView();
        linewView.backgroundColor = UIColorFromHex(rgbValue: 0x000000).withAlphaComponent(0.1);
        return linewView;
    }()
    
    override func layoutSubviews() {
        super.layoutSubviews();
        self.contentView.addSubview(self.textField);
        self.textField.mas_makeConstraints { (make) in
            make?.left.mas_equalTo()(12);
            make?.centerY.mas_equalTo()(0);
            make?.height.mas_equalTo()(21);
            make?.right.mas_equalTo()(-12);
        }
        
        self.contentView.addSubview(self.lineView);
        self.lineView.mas_makeConstraints { (make) in
            make?.left.mas_equalTo()(0);
            make?.right.mas_equalTo()(0);
            make?.bottom.mas_equalTo()(0);
            make?.height.mas_equalTo()(1);
        }
    }

}
//- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField;
extension YQAddressAddBaseCell {
    func textFieldShouldBeginEditing(_ textField: UITextField) -> Bool {
        return self.isTextFieldEdit;
    }
}
